multiple Perl ` print $cgi->header, <<HTML; .... HTML ` statement gives problem
Posted
by dexter
on Stack Overflow
See other posts from Stack Overflow
or by dexter
Published on 2010-04-05T06:17:01Z
Indexed on
2010/04/05
6:23 UTC
Read the original article
Hit count: 503
i have something like:
#!/usr/bin/perl
use strict;
use warnings;
use CGI::Simple;
use DBI;
my $cgi = CGI::Simple->new;
if ($cgi->param('selid'))
{
print $cgi->header, <<HTML;
<br/>this is SELECT
HTML
}
elsif ($cgi->param('delid'))
{
print $cgi->header, <<HTML;
<b>this is DELETE</b>
HTML
}
elsif ($cgi->param('upid'))
{
print $cgi->header, <<HTML;
<b>this is UPDATE</b>
HTML
}
when i run this i get an error like:
Error message: Can't find string terminator " HTML" anywhere before EOF at C:/xampp/htdocs/perl/action.pl line 14. ,
and when give space between <<
and HTML;
like :print $cgi->header, << HTML;
error changes to:
Error message: Can't find string terminator " " anywhere before EOF at C:/xampp/htdocs/perl/action.pl line 14. ,
what would be the reason for this?
note: parameters are passed from another page('selid' or 'delid' or 'upid')
© Stack Overflow or respective owner